<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html 
     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>Module: ActionView::Helpers::FormTagHelper</title>
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  <meta http-equiv="Content-Script-Type" content="text/javascript" />
  <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
  <script type="text/javascript">
  // <![CDATA[

  function popupCode( url ) {
    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
  }

  function toggleCode( id ) {
    if ( document.getElementById )
      elem = document.getElementById( id );
    else if ( document.all )
      elem = eval( "document.all." + id );
    else
      return false;

    elemStyle = elem.style;
    
    if ( elemStyle.display != "block" ) {
      elemStyle.display = "block"
    } else {
      elemStyle.display = "none"
    }

    return true;
  }
  
  // Make codeblocks hidden by default
  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
  
  // ]]>
  </script>

</head>
<body>



    <div id="classHeader">
        <table class="header-table">
        <tr class="top-aligned-row">
          <td><strong>Module</strong></td>
          <td class="class-name-in-header">ActionView::Helpers::FormTagHelper</td>
        </tr>
        <tr class="top-aligned-row">
            <td><strong>In:</strong></td>
            <td>
                <a href="../../../files/vendor/rails/actionpack/lib/action_view/helpers/form_tag_helper_rb.html">
                vendor/rails/actionpack/lib/action_view/helpers/form_tag_helper.rb
                </a>
        <br />
            </td>
        </tr>

        </table>
    </div>
  <!-- banner header -->

  <div id="bodyContent">



  <div id="contextContent">

    <div id="description">
      <p>
Provides a number of methods for creating form tags that doesn&#8216;t rely
on an Active Record object assigned to the template like <a
href="FormHelper.html">FormHelper</a> does. Instead, you provide the names
and values manually.
</p>
<p>
NOTE: The HTML options <tt>disabled</tt>, <tt>readonly</tt>, and
<tt>multiple</tt> can all be treated as booleans. So specifying
<tt>:disabled =&gt; true</tt> will give
<tt>disabled=&quot;disabled&quot;</tt>.
</p>

    </div>


   </div>

    <div id="method-list">
      <h3 class="section-bar">Methods</h3>

      <div class="name-list">
      <a href="#M002102">check_box_tag</a>&nbsp;&nbsp;
      <a href="#M002106">field_set_tag</a>&nbsp;&nbsp;
      <a href="#M002099">file_field_tag</a>&nbsp;&nbsp;
      <a href="#M002094">form_tag</a>&nbsp;&nbsp;
      <a href="#M002098">hidden_field_tag</a>&nbsp;&nbsp;
      <a href="#M002105">image_submit_tag</a>&nbsp;&nbsp;
      <a href="#M002097">label_tag</a>&nbsp;&nbsp;
      <a href="#M002100">password_field_tag</a>&nbsp;&nbsp;
      <a href="#M002103">radio_button_tag</a>&nbsp;&nbsp;
      <a href="#M002095">select_tag</a>&nbsp;&nbsp;
      <a href="#M002104">submit_tag</a>&nbsp;&nbsp;
      <a href="#M002101">text_area_tag</a>&nbsp;&nbsp;
      <a href="#M002096">text_field_tag</a>&nbsp;&nbsp;
      </div>
    </div>

  </div>


    <!-- if includes -->

    <div id="section">





      


    <!-- if method_list -->
    <div id="methods">
      <h3 class="section-bar">Public Instance methods</h3>

      <div id="method-M002102" class="method-detail">
        <a name="M002102"></a>

        <div class="method-heading">
          <a href="#M002102" class="method-signature">
          <span class="method-name">check_box_tag</span><span class="method-args">(name, value = &quot;1&quot;, checked = false, options = {})</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Creates a check box form input tag.
</p>
<h4>Options</h4>
<ul>
<li><tt>:disabled</tt> - If set to true, the user will not be able to use this
input.

</li>
<li>Any other key creates standard HTML options for the tag.

</li>
</ul>
<h4>Examples</h4>
<pre>
  check_box_tag 'accept'
  # =&gt; &lt;input id=&quot;accept&quot; name=&quot;accept&quot; type=&quot;checkbox&quot; value=&quot;1&quot; /&gt;

  check_box_tag 'rock', 'rock music'
  # =&gt; &lt;input id=&quot;rock&quot; name=&quot;rock&quot; type=&quot;checkbox&quot; value=&quot;rock music&quot; /&gt;

  check_box_tag 'receive_email', 'yes', true
  # =&gt; &lt;input checked=&quot;checked&quot; id=&quot;receive_email&quot; name=&quot;receive_email&quot; type=&quot;checkbox&quot; value=&quot;yes&quot; /&gt;

  check_box_tag 'tos', 'yes', false, :class =&gt; 'accept_tos'
  # =&gt; &lt;input class=&quot;accept_tos&quot; id=&quot;tos&quot; name=&quot;tos&quot; type=&quot;checkbox&quot; value=&quot;yes&quot; /&gt;

  check_box_tag 'eula', 'accepted', false, :disabled =&gt; true
  # =&gt; &lt;input disabled=&quot;disabled&quot; id=&quot;eula&quot; name=&quot;eula&quot; type=&quot;checkbox&quot; value=&quot;accepted&quot; /&gt;
</pre>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M002102-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M002102-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/rails/actionpack/lib/action_view/helpers/form_tag_helper.rb, line 284</span>
284:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">check_box_tag</span>(<span class="ruby-identifier">name</span>, <span class="ruby-identifier">value</span> = <span class="ruby-value str">&quot;1&quot;</span>, <span class="ruby-identifier">checked</span> = <span class="ruby-keyword kw">false</span>, <span class="ruby-identifier">options</span> = {})
285:         <span class="ruby-identifier">html_options</span> = { <span class="ruby-value str">&quot;type&quot;</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">&quot;checkbox&quot;</span>, <span class="ruby-value str">&quot;name&quot;</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">name</span>, <span class="ruby-value str">&quot;id&quot;</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">sanitize_to_id</span>(<span class="ruby-identifier">name</span>), <span class="ruby-value str">&quot;value&quot;</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">value</span> }.<span class="ruby-identifier">update</span>(<span class="ruby-identifier">options</span>.<span class="ruby-identifier">stringify_keys</span>)
286:         <span class="ruby-identifier">html_options</span>[<span class="ruby-value str">&quot;checked&quot;</span>] = <span class="ruby-value str">&quot;checked&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">checked</span>
287:         <span class="ruby-identifier">tag</span> <span class="ruby-identifier">:input</span>, <span class="ruby-identifier">html_options</span>
288:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M002106" class="method-detail">
        <a name="M002106"></a>

        <div class="method-heading">
          <a href="#M002106" class="method-signature">
          <span class="method-name">field_set_tag</span><span class="method-args">(legend = nil, options = nil, &amp;block)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Creates a field set for grouping HTML form elements.
</p>
<p>
<tt>legend</tt> will become the fieldset&#8216;s title (optional as per
W3C). <tt>options</tt> accept the same values as tag.
</p>
<h3>Examples</h3>
<pre>
  &lt;% field_set_tag do %&gt;
    &lt;p&gt;&lt;%= text_field_tag 'name' %&gt;&lt;/p&gt;
  &lt;% end %&gt;
  # =&gt; &lt;fieldset&gt;&lt;p&gt;&lt;input id=&quot;name&quot; name=&quot;name&quot; type=&quot;text&quot; /&gt;&lt;/p&gt;&lt;/fieldset&gt;

  &lt;% field_set_tag 'Your details' do %&gt;
    &lt;p&gt;&lt;%= text_field_tag 'name' %&gt;&lt;/p&gt;
  &lt;% end %&gt;
  # =&gt; &lt;fieldset&gt;&lt;legend&gt;Your details&lt;/legend&gt;&lt;p&gt;&lt;input id=&quot;name&quot; name=&quot;name&quot; type=&quot;text&quot; /&gt;&lt;/p&gt;&lt;/fieldset&gt;

  &lt;% field_set_tag nil, :class =&gt; 'format' do %&gt;
    &lt;p&gt;&lt;%= text_field_tag 'name' %&gt;&lt;/p&gt;
  &lt;% end %&gt;
  # =&gt; &lt;fieldset class=&quot;format&quot;&gt;&lt;p&gt;&lt;input id=&quot;name&quot; name=&quot;name&quot; type=&quot;text&quot; /&gt;&lt;/p&gt;&lt;/fieldset&gt;
</pre>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M002106-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M002106-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/rails/actionpack/lib/action_view/helpers/form_tag_helper.rb, line 424</span>
424:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">field_set_tag</span>(<span class="ruby-identifier">legend</span> = <span class="ruby-keyword kw">nil</span>, <span class="ruby-identifier">options</span> = <span class="ruby-keyword kw">nil</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>)
425:         <span class="ruby-identifier">content</span> = <span class="ruby-identifier">capture</span>(<span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>)
426:         <span class="ruby-identifier">concat</span>(<span class="ruby-identifier">tag</span>(<span class="ruby-identifier">:fieldset</span>, <span class="ruby-identifier">options</span>, <span class="ruby-keyword kw">true</span>))
427:         <span class="ruby-identifier">concat</span>(<span class="ruby-identifier">content_tag</span>(<span class="ruby-identifier">:legend</span>, <span class="ruby-identifier">legend</span>)) <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">legend</span>.<span class="ruby-identifier">blank?</span>
428:         <span class="ruby-identifier">concat</span>(<span class="ruby-identifier">content</span>)
429:         <span class="ruby-identifier">concat</span>(<span class="ruby-value str">&quot;&lt;/fieldset&gt;&quot;</span>)
430:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M002099" class="method-detail">
        <a name="M002099"></a>

        <div class="method-heading">
          <a href="#M002099" class="method-signature">
          <span class="method-name">file_field_tag</span><span class="method-args">(name, options = {})</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Creates a file upload field. If you are using file uploads then you will
also need to set the multipart option for the form tag:
</p>
<pre>
  &lt;% form_tag '/upload', :multipart =&gt; true do %&gt;
    &lt;label for=&quot;file&quot;&gt;File to Upload&lt;/label&gt; &lt;%= file_field_tag &quot;file&quot; %&gt;
    &lt;%= submit_tag %&gt;
  &lt;% end %&gt;
</pre>
<p>
The specified URL will then be passed a File object containing the selected
file, or if the field was left blank, a StringIO object.
</p>
<h4>Options</h4>
<ul>
<li>Creates standard HTML attributes for the tag.

</li>
<li><tt>:disabled</tt> - If set to true, the user will not be able to use this
input.

</li>
</ul>
<h4>Examples</h4>
<pre>
  file_field_tag 'attachment'
  # =&gt; &lt;input id=&quot;attachment&quot; name=&quot;attachment&quot; type=&quot;file&quot; /&gt;

  file_field_tag 'avatar', :class =&gt; 'profile-input'
  # =&gt; &lt;input class=&quot;profile-input&quot; id=&quot;avatar&quot; name=&quot;avatar&quot; type=&quot;file&quot; /&gt;

  file_field_tag 'picture', :disabled =&gt; true
  # =&gt; &lt;input disabled=&quot;disabled&quot; id=&quot;picture&quot; name=&quot;picture&quot; type=&quot;file&quot; /&gt;

  file_field_tag 'resume', :value =&gt; '~/resume.doc'
  # =&gt; &lt;input id=&quot;resume&quot; name=&quot;resume&quot; type=&quot;file&quot; value=&quot;~/resume.doc&quot; /&gt;

  file_field_tag 'user_pic', :accept =&gt; 'image/png,image/gif,image/jpeg'
  # =&gt; &lt;input accept=&quot;image/png,image/gif,image/jpeg&quot; id=&quot;user_pic&quot; name=&quot;user_pic&quot; type=&quot;file&quot; /&gt;

  file_field_tag 'file', :accept =&gt; 'text/html', :class =&gt; 'upload', :value =&gt; 'index.html'
  # =&gt; &lt;input accept=&quot;text/html&quot; class=&quot;upload&quot; id=&quot;file&quot; name=&quot;file&quot; type=&quot;file&quot; value=&quot;index.html&quot; /&gt;
</pre>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M002099-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M002099-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/rails/actionpack/lib/action_view/helpers/form_tag_helper.rb, line 189</span>
189:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">file_field_tag</span>(<span class="ruby-identifier">name</span>, <span class="ruby-identifier">options</span> = {})
190:         <span class="ruby-identifier">text_field_tag</span>(<span class="ruby-identifier">name</span>, <span class="ruby-keyword kw">nil</span>, <span class="ruby-identifier">options</span>.<span class="ruby-identifier">update</span>(<span class="ruby-value str">&quot;type&quot;</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">&quot;file&quot;</span>))
191:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M002094" class="method-detail">
        <a name="M002094"></a>

        <div class="method-heading">
          <a href="#M002094" class="method-signature">
          <span class="method-name">form_tag</span><span class="method-args">(url_for_options = {}, options = {}, *parameters_for_url, &amp;block)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Starts a form tag that points the action to an url configured with
<tt>url_for_options</tt> just like ActionController::Base#url_for. The
method for the form defaults to POST.
</p>
<h4>Options</h4>
<ul>
<li><tt>:multipart</tt> - If set to true, the enctype is set to
&quot;multipart/form-data&quot;.

</li>
<li><tt>:method</tt> - The method to use when submitting the form, usually
either &quot;get&quot; or &quot;post&quot;. If &quot;put&quot;,
&quot;delete&quot;, or another verb is used, a hidden input with name
<tt>_method</tt> is added to simulate the verb over post.

</li>
<li>A list of parameters to feed to the URL the form will be posted to.

</li>
</ul>
<h4>Examples</h4>
<pre>
  form_tag('/posts')
  # =&gt; &lt;form action=&quot;/posts&quot; method=&quot;post&quot;&gt;

  form_tag('/posts/1', :method =&gt; :put)
  # =&gt; &lt;form action=&quot;/posts/1&quot; method=&quot;put&quot;&gt;

  form_tag('/upload', :multipart =&gt; true)
  # =&gt; &lt;form action=&quot;/upload&quot; method=&quot;post&quot; enctype=&quot;multipart/form-data&quot;&gt;

  &lt;% form_tag '/posts' do -%&gt;
    &lt;div&gt;&lt;%= submit_tag 'Save' %&gt;&lt;/div&gt;
  &lt;% end -%&gt;
  # =&gt; &lt;form action=&quot;/posts&quot; method=&quot;post&quot;&gt;&lt;div&gt;&lt;input type=&quot;submit&quot; name=&quot;submit&quot; value=&quot;Save&quot; /&gt;&lt;/div&gt;&lt;/form&gt;
</pre>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M002094-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M002094-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/rails/actionpack/lib/action_view/helpers/form_tag_helper.rb, line 36</span>
36:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">form_tag</span>(<span class="ruby-identifier">url_for_options</span> = {}, <span class="ruby-identifier">options</span> = {}, <span class="ruby-operator">*</span><span class="ruby-identifier">parameters_for_url</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>)
37:         <span class="ruby-identifier">html_options</span> = <span class="ruby-identifier">html_options_for_form</span>(<span class="ruby-identifier">url_for_options</span>, <span class="ruby-identifier">options</span>, <span class="ruby-operator">*</span><span class="ruby-identifier">parameters_for_url</span>)
38:         <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">block_given?</span>
39:           <span class="ruby-identifier">form_tag_in_block</span>(<span class="ruby-identifier">html_options</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>)
40:         <span class="ruby-keyword kw">else</span>
41:           <span class="ruby-identifier">form_tag_html</span>(<span class="ruby-identifier">html_options</span>)
42:         <span class="ruby-keyword kw">end</span>
43:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M002098" class="method-detail">
        <a name="M002098"></a>

        <div class="method-heading">
          <a href="#M002098" class="method-signature">
          <span class="method-name">hidden_field_tag</span><span class="method-args">(name, value = nil, options = {})</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Creates a hidden form input field used to transmit data that would be lost
due to HTTP&#8216;s statelessness or data that should be hidden from the
user.
</p>
<h4>Options</h4>
<ul>
<li>Creates standard HTML attributes for the tag.

</li>
</ul>
<h4>Examples</h4>
<pre>
  hidden_field_tag 'tags_list'
  # =&gt; &lt;input id=&quot;tags_list&quot; name=&quot;tags_list&quot; type=&quot;hidden&quot; /&gt;

  hidden_field_tag 'token', 'VUBJKB23UIVI1UU1VOBVI@'
  # =&gt; &lt;input id=&quot;token&quot; name=&quot;token&quot; type=&quot;hidden&quot; value=&quot;VUBJKB23UIVI1UU1VOBVI@&quot; /&gt;

  hidden_field_tag 'collected_input', '', :onchange =&gt; &quot;alert('Input collected!')&quot;
  # =&gt; &lt;input id=&quot;collected_input&quot; name=&quot;collected_input&quot; onchange=&quot;alert('Input collected!')&quot;
  #    type=&quot;hidden&quot; value=&quot;&quot; /&gt;
</pre>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M002098-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M002098-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/rails/actionpack/lib/action_view/helpers/form_tag_helper.rb, line 152</span>
152:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">hidden_field_tag</span>(<span class="ruby-identifier">name</span>, <span class="ruby-identifier">value</span> = <span class="ruby-keyword kw">nil</span>, <span class="ruby-identifier">options</span> = {})
153:         <span class="ruby-identifier">text_field_tag</span>(<span class="ruby-identifier">name</span>, <span class="ruby-identifier">value</span>, <span class="ruby-identifier">options</span>.<span class="ruby-identifier">stringify_keys</span>.<span class="ruby-identifier">update</span>(<span class="ruby-value str">&quot;type&quot;</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">&quot;hidden&quot;</span>))
154:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M002105" class="method-detail">
        <a name="M002105"></a>

        <div class="method-heading">
          <a href="#M002105" class="method-signature">
          <span class="method-name">image_submit_tag</span><span class="method-args">(source, options = {})</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Displays an image which when clicked will submit the form.
</p>
<p>
<tt>source</tt> is passed to <a
href="AssetTagHelper.html#M002078">AssetTagHelper#image_path</a>
</p>
<h4>Options</h4>
<ul>
<li><tt>:confirm =&gt; &#8216;question?&#8216;</tt> - This will add a
JavaScript confirm prompt with the question specified. If the user accepts,
the form is processed normally, otherwise no action is taken.

</li>
<li><tt>:disabled</tt> - If set to true, the user will not be able to use this
input.

</li>
<li>Any other key creates standard HTML options for the tag.

</li>
</ul>
<h4>Examples</h4>
<pre>
  image_submit_tag(&quot;login.png&quot;)
  # =&gt; &lt;input src=&quot;/images/login.png&quot; type=&quot;image&quot; /&gt;

  image_submit_tag(&quot;purchase.png&quot;, :disabled =&gt; true)
  # =&gt; &lt;input disabled=&quot;disabled&quot; src=&quot;/images/purchase.png&quot; type=&quot;image&quot; /&gt;

  image_submit_tag(&quot;search.png&quot;, :class =&gt; 'search-button')
  # =&gt; &lt;input class=&quot;search-button&quot; src=&quot;/images/search.png&quot; type=&quot;image&quot; /&gt;

  image_submit_tag(&quot;agree.png&quot;, :disabled =&gt; true, :class =&gt; &quot;agree-disagree-button&quot;)
  # =&gt; &lt;input class=&quot;agree-disagree-button&quot; disabled=&quot;disabled&quot; src=&quot;/images/agree.png&quot; type=&quot;image&quot; /&gt;
</pre>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M002105-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M002105-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/rails/actionpack/lib/action_view/helpers/form_tag_helper.rb, line 393</span>
393:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">image_submit_tag</span>(<span class="ruby-identifier">source</span>, <span class="ruby-identifier">options</span> = {})
394:         <span class="ruby-identifier">options</span>.<span class="ruby-identifier">stringify_keys!</span>
395: 
396:         <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">confirm</span> = <span class="ruby-identifier">options</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-value str">&quot;confirm&quot;</span>)
397:           <span class="ruby-identifier">options</span>[<span class="ruby-value str">&quot;onclick&quot;</span>] <span class="ruby-operator">||=</span> <span class="ruby-value str">''</span>
398:           <span class="ruby-identifier">options</span>[<span class="ruby-value str">&quot;onclick&quot;</span>] <span class="ruby-operator">+=</span> <span class="ruby-node">&quot;return #{confirm_javascript_function(confirm)};&quot;</span>
399:         <span class="ruby-keyword kw">end</span>
400: 
401:         <span class="ruby-identifier">tag</span> <span class="ruby-identifier">:input</span>, { <span class="ruby-value str">&quot;type&quot;</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">&quot;image&quot;</span>, <span class="ruby-value str">&quot;src&quot;</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">path_to_image</span>(<span class="ruby-identifier">source</span>) }.<span class="ruby-identifier">update</span>(<span class="ruby-identifier">options</span>.<span class="ruby-identifier">stringify_keys</span>)
402:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M002097" class="method-detail">
        <a name="M002097"></a>

        <div class="method-heading">
          <a href="#M002097" class="method-signature">
          <span class="method-name">label_tag</span><span class="method-args">(name, text = nil, options = {})</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Creates a label field
</p>
<h4>Options</h4>
<ul>
<li>Creates standard HTML attributes for the tag.

</li>
</ul>
<h4>Examples</h4>
<pre>
  label_tag 'name'
  # =&gt; &lt;label for=&quot;name&quot;&gt;Name&lt;/label&gt;

  label_tag 'name', 'Your name'
  # =&gt; &lt;label for=&quot;name&quot;&gt;Your Name&lt;/label&gt;

  label_tag 'name', nil, :class =&gt; 'small_label'
  # =&gt; &lt;label for=&quot;name&quot; class=&quot;small_label&quot;&gt;Name&lt;/label&gt;
</pre>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M002097-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M002097-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/rails/actionpack/lib/action_view/helpers/form_tag_helper.rb, line 132</span>
132:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">label_tag</span>(<span class="ruby-identifier">name</span>, <span class="ruby-identifier">text</span> = <span class="ruby-keyword kw">nil</span>, <span class="ruby-identifier">options</span> = {})
133:         <span class="ruby-identifier">content_tag</span> <span class="ruby-identifier">:label</span>, <span class="ruby-identifier">text</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">name</span>.<span class="ruby-identifier">to_s</span>.<span class="ruby-identifier">humanize</span>, { <span class="ruby-value str">&quot;for&quot;</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">sanitize_to_id</span>(<span class="ruby-identifier">name</span>) }.<span class="ruby-identifier">update</span>(<span class="ruby-identifier">options</span>.<span class="ruby-identifier">stringify_keys</span>)
134:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M002100" class="method-detail">
        <a name="M002100"></a>

        <div class="method-heading">
          <a href="#M002100" class="method-signature">
          <span class="method-name">password_field_tag</span><span class="method-args">(name = &quot;password&quot;, value = nil, options = {})</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Creates a password field, a masked text field that will hide the users
input behind a mask character.
</p>
<h4>Options</h4>
<ul>
<li><tt>:disabled</tt> - If set to true, the user will not be able to use this
input.

</li>
<li><tt>:size</tt> - The number of visible characters that will fit in the
input.

</li>
<li><tt>:maxlength</tt> - The maximum number of characters that the browser
will allow the user to enter.

</li>
<li>Any other key creates standard HTML attributes for the tag.

</li>
</ul>
<h4>Examples</h4>
<pre>
  password_field_tag 'pass'
  # =&gt; &lt;input id=&quot;pass&quot; name=&quot;pass&quot; type=&quot;password&quot; /&gt;

  password_field_tag 'secret', 'Your secret here'
  # =&gt; &lt;input id=&quot;secret&quot; name=&quot;secret&quot; type=&quot;password&quot; value=&quot;Your secret here&quot; /&gt;

  password_field_tag 'masked', nil, :class =&gt; 'masked_input_field'
  # =&gt; &lt;input class=&quot;masked_input_field&quot; id=&quot;masked&quot; name=&quot;masked&quot; type=&quot;password&quot; /&gt;

  password_field_tag 'token', '', :size =&gt; 15
  # =&gt; &lt;input id=&quot;token&quot; name=&quot;token&quot; size=&quot;15&quot; type=&quot;password&quot; value=&quot;&quot; /&gt;

  password_field_tag 'key', nil, :maxlength =&gt; 16
  # =&gt; &lt;input id=&quot;key&quot; maxlength=&quot;16&quot; name=&quot;key&quot; type=&quot;password&quot; /&gt;

  password_field_tag 'confirm_pass', nil, :disabled =&gt; true
  # =&gt; &lt;input disabled=&quot;disabled&quot; id=&quot;confirm_pass&quot; name=&quot;confirm_pass&quot; type=&quot;password&quot; /&gt;

  password_field_tag 'pin', '1234', :maxlength =&gt; 4, :size =&gt; 6, :class =&gt; &quot;pin-input&quot;
  # =&gt; &lt;input class=&quot;pin-input&quot; id=&quot;pin&quot; maxlength=&quot;4&quot; name=&quot;pin&quot; size=&quot;6&quot; type=&quot;password&quot; value=&quot;1234&quot; /&gt;
</pre>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M002100-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M002100-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/rails/actionpack/lib/action_view/helpers/form_tag_helper.rb, line 222</span>
222:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">password_field_tag</span>(<span class="ruby-identifier">name</span> = <span class="ruby-value str">&quot;password&quot;</span>, <span class="ruby-identifier">value</span> = <span class="ruby-keyword kw">nil</span>, <span class="ruby-identifier">options</span> = {})
223:         <span class="ruby-identifier">text_field_tag</span>(<span class="ruby-identifier">name</span>, <span class="ruby-identifier">value</span>, <span class="ruby-identifier">options</span>.<span class="ruby-identifier">update</span>(<span class="ruby-value str">&quot;type&quot;</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">&quot;password&quot;</span>))
224:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M002103" class="method-detail">
        <a name="M002103"></a>

        <div class="method-heading">
          <a href="#M002103" class="method-signature">
          <span class="method-name">radio_button_tag</span><span class="method-args">(name, value, checked = false, options = {})</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Creates a radio button; use groups of radio buttons named the same to allow
users to select from a group of options.
</p>
<h4>Options</h4>
<ul>
<li><tt>:disabled</tt> - If set to true, the user will not be able to use this
input.

</li>
<li>Any other key creates standard HTML options for the tag.

</li>
</ul>
<h4>Examples</h4>
<pre>
  radio_button_tag 'gender', 'male'
  # =&gt; &lt;input id=&quot;gender_male&quot; name=&quot;gender&quot; type=&quot;radio&quot; value=&quot;male&quot; /&gt;

  radio_button_tag 'receive_updates', 'no', true
  # =&gt; &lt;input checked=&quot;checked&quot; id=&quot;receive_updates_no&quot; name=&quot;receive_updates&quot; type=&quot;radio&quot; value=&quot;no&quot; /&gt;

  radio_button_tag 'time_slot', &quot;3:00 p.m.&quot;, false, :disabled =&gt; true
  # =&gt; &lt;input disabled=&quot;disabled&quot; id=&quot;time_slot_300_pm&quot; name=&quot;time_slot&quot; type=&quot;radio&quot; value=&quot;3:00 p.m.&quot; /&gt;

  radio_button_tag 'color', &quot;green&quot;, true, :class =&gt; &quot;color_input&quot;
  # =&gt; &lt;input checked=&quot;checked&quot; class=&quot;color_input&quot; id=&quot;color_green&quot; name=&quot;color&quot; type=&quot;radio&quot; value=&quot;green&quot; /&gt;
</pre>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M002103-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M002103-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/rails/actionpack/lib/action_view/helpers/form_tag_helper.rb, line 309</span>
309:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">radio_button_tag</span>(<span class="ruby-identifier">name</span>, <span class="ruby-identifier">value</span>, <span class="ruby-identifier">checked</span> = <span class="ruby-keyword kw">false</span>, <span class="ruby-identifier">options</span> = {})
310:         <span class="ruby-identifier">pretty_tag_value</span> = <span class="ruby-identifier">value</span>.<span class="ruby-identifier">to_s</span>.<span class="ruby-identifier">gsub</span>(<span class="ruby-regexp re">/\s/</span>, <span class="ruby-value str">&quot;_&quot;</span>).<span class="ruby-identifier">gsub</span>(<span class="ruby-regexp re">/(?!-)\W/</span>, <span class="ruby-value str">&quot;&quot;</span>).<span class="ruby-identifier">downcase</span>
311:         <span class="ruby-identifier">pretty_name</span> = <span class="ruby-identifier">name</span>.<span class="ruby-identifier">to_s</span>.<span class="ruby-identifier">gsub</span>(<span class="ruby-regexp re">/\[/</span>, <span class="ruby-value str">&quot;_&quot;</span>).<span class="ruby-identifier">gsub</span>(<span class="ruby-regexp re">/\]/</span>, <span class="ruby-value str">&quot;&quot;</span>)
312:         <span class="ruby-identifier">html_options</span> = { <span class="ruby-value str">&quot;type&quot;</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">&quot;radio&quot;</span>, <span class="ruby-value str">&quot;name&quot;</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">name</span>, <span class="ruby-value str">&quot;id&quot;</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-node">&quot;#{pretty_name}_#{pretty_tag_value}&quot;</span>, <span class="ruby-value str">&quot;value&quot;</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">value</span> }.<span class="ruby-identifier">update</span>(<span class="ruby-identifier">options</span>.<span class="ruby-identifier">stringify_keys</span>)
313:         <span class="ruby-identifier">html_options</span>[<span class="ruby-value str">&quot;checked&quot;</span>] = <span class="ruby-value str">&quot;checked&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">checked</span>
314:         <span class="ruby-identifier">tag</span> <span class="ruby-identifier">:input</span>, <span class="ruby-identifier">html_options</span>
315:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M002095" class="method-detail">
        <a name="M002095"></a>

        <div class="method-heading">
          <a href="#M002095" class="method-signature">
          <span class="method-name">select_tag</span><span class="method-args">(name, option_tags = nil, options = {})</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Creates a dropdown selection box, or if the <tt>:multiple</tt> option is
set to true, a multiple choice selection box.
</p>
<p>
Helpers::FormOptions can be used to create common select boxes such as
countries, time zones, or associated records. <tt>option_tags</tt> is a
string containing the option tags for the select box.
</p>
<h4>Options</h4>
<ul>
<li><tt>:multiple</tt> - If set to true the selection will allow multiple
choices.

</li>
<li><tt>:disabled</tt> - If set to true, the user will not be able to use this
input.

</li>
<li>Any other key creates standard HTML attributes for the tag.

</li>
</ul>
<h4>Examples</h4>
<pre>
  select_tag &quot;people&quot;, &quot;&lt;option&gt;David&lt;/option&gt;&quot;
  # =&gt; &lt;select id=&quot;people&quot; name=&quot;people&quot;&gt;&lt;option&gt;David&lt;/option&gt;&lt;/select&gt;

  select_tag &quot;count&quot;, &quot;&lt;option&gt;1&lt;/option&gt;&lt;option&gt;2&lt;/option&gt;&lt;option&gt;3&lt;/option&gt;&lt;option&gt;4&lt;/option&gt;&quot;
  # =&gt; &lt;select id=&quot;count&quot; name=&quot;count&quot;&gt;&lt;option&gt;1&lt;/option&gt;&lt;option&gt;2&lt;/option&gt;
  #    &lt;option&gt;3&lt;/option&gt;&lt;option&gt;4&lt;/option&gt;&lt;/select&gt;

  select_tag &quot;colors&quot;, &quot;&lt;option&gt;Red&lt;/option&gt;&lt;option&gt;Green&lt;/option&gt;&lt;option&gt;Blue&lt;/option&gt;&quot;, :multiple =&gt; true
  # =&gt; &lt;select id=&quot;colors&quot; multiple=&quot;multiple&quot; name=&quot;colors[]&quot;&gt;&lt;option&gt;Red&lt;/option&gt;
  #    &lt;option&gt;Green&lt;/option&gt;&lt;option&gt;Blue&lt;/option&gt;&lt;/select&gt;

  select_tag &quot;locations&quot;, &quot;&lt;option&gt;Home&lt;/option&gt;&lt;option selected=&quot;selected&quot;&gt;Work&lt;/option&gt;&lt;option&gt;Out&lt;/option&gt;&quot;
  # =&gt; &lt;select id=&quot;locations&quot; name=&quot;locations&quot;&gt;&lt;option&gt;Home&lt;/option&gt;&lt;option selected='selected'&gt;Work&lt;/option&gt;
  #    &lt;option&gt;Out&lt;/option&gt;&lt;/select&gt;

  select_tag &quot;access&quot;, &quot;&lt;option&gt;Read&lt;/option&gt;&lt;option&gt;Write&lt;/option&gt;&quot;, :multiple =&gt; true, :class =&gt; 'form_input'
  # =&gt; &lt;select class=&quot;form_input&quot; id=&quot;access&quot; multiple=&quot;multiple&quot; name=&quot;access[]&quot;&gt;&lt;option&gt;Read&lt;/option&gt;
  #    &lt;option&gt;Write&lt;/option&gt;&lt;/select&gt;

  select_tag &quot;destination&quot;, &quot;&lt;option&gt;NYC&lt;/option&gt;&lt;option&gt;Paris&lt;/option&gt;&lt;option&gt;Rome&lt;/option&gt;&quot;, :disabled =&gt; true
  # =&gt; &lt;select disabled=&quot;disabled&quot; id=&quot;destination&quot; name=&quot;destination&quot;&gt;&lt;option&gt;NYC&lt;/option&gt;
  #    &lt;option&gt;Paris&lt;/option&gt;&lt;option&gt;Rome&lt;/option&gt;&lt;/select&gt;
</pre>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M002095-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M002095-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/rails/actionpack/lib/action_view/helpers/form_tag_helper.rb, line 79</span>
79:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">select_tag</span>(<span class="ruby-identifier">name</span>, <span class="ruby-identifier">option_tags</span> = <span class="ruby-keyword kw">nil</span>, <span class="ruby-identifier">options</span> = {})
80:         <span class="ruby-identifier">html_name</span> = (<span class="ruby-identifier">options</span>[<span class="ruby-identifier">:multiple</span>] <span class="ruby-operator">==</span> <span class="ruby-keyword kw">true</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-operator">!</span><span class="ruby-identifier">name</span>.<span class="ruby-identifier">to_s</span>.<span class="ruby-identifier">ends_with?</span>(<span class="ruby-value str">&quot;[]&quot;</span>)) <span class="ruby-operator">?</span> <span class="ruby-node">&quot;#{name}[]&quot;</span> <span class="ruby-operator">:</span> <span class="ruby-identifier">name</span>
81:         <span class="ruby-identifier">content_tag</span> <span class="ruby-identifier">:select</span>, <span class="ruby-identifier">option_tags</span>, { <span class="ruby-value str">&quot;name&quot;</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">html_name</span>, <span class="ruby-value str">&quot;id&quot;</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">sanitize_to_id</span>(<span class="ruby-identifier">name</span>) }.<span class="ruby-identifier">update</span>(<span class="ruby-identifier">options</span>.<span class="ruby-identifier">stringify_keys</span>)
82:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M002104" class="method-detail">
        <a name="M002104"></a>

        <div class="method-heading">
          <a href="#M002104" class="method-signature">
          <span class="method-name">submit_tag</span><span class="method-args">(value = &quot;Save changes&quot;, options = {})</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Creates a submit button with the text <tt>value</tt> as the caption.
</p>
<h4>Options</h4>
<ul>
<li><tt>:confirm =&gt; &#8216;question?&#8216;</tt> - This will add a
JavaScript confirm prompt with the question specified. If the user accepts,
the form is processed normally, otherwise no action is taken.

</li>
<li><tt>:disabled</tt> - If true, the user will not be able to use this input.

</li>
<li><tt>:disable_with</tt> - Value of this parameter will be used as the value
for a disabled version of the submit button when the form is submitted.

</li>
<li>Any other key creates standard HTML options for the tag.

</li>
</ul>
<h4>Examples</h4>
<pre>
  submit_tag
  # =&gt; &lt;input name=&quot;commit&quot; type=&quot;submit&quot; value=&quot;Save changes&quot; /&gt;

  submit_tag &quot;Edit this article&quot;
  # =&gt; &lt;input name=&quot;commit&quot; type=&quot;submit&quot; value=&quot;Edit this article&quot; /&gt;

  submit_tag &quot;Save edits&quot;, :disabled =&gt; true
  # =&gt; &lt;input disabled=&quot;disabled&quot; name=&quot;commit&quot; type=&quot;submit&quot; value=&quot;Save edits&quot; /&gt;

  submit_tag &quot;Complete sale&quot;, :disable_with =&gt; &quot;Please wait...&quot;
  # =&gt; &lt;input name=&quot;commit&quot; onclick=&quot;this.disabled=true;this.value='Please wait...';this.form.submit();&quot;
  #    type=&quot;submit&quot; value=&quot;Complete sale&quot; /&gt;

  submit_tag nil, :class =&gt; &quot;form_submit&quot;
  # =&gt; &lt;input class=&quot;form_submit&quot; name=&quot;commit&quot; type=&quot;submit&quot; /&gt;

  submit_tag &quot;Edit&quot;, :disable_with =&gt; &quot;Editing...&quot;, :class =&gt; &quot;edit-button&quot;
  # =&gt; &lt;input class=&quot;edit-button&quot; onclick=&quot;this.disabled=true;this.value='Editing...';this.form.submit();&quot;
  #    name=&quot;commit&quot; type=&quot;submit&quot; value=&quot;Edit&quot; /&gt;
</pre>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M002104-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M002104-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/rails/actionpack/lib/action_view/helpers/form_tag_helper.rb, line 348</span>
348:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">submit_tag</span>(<span class="ruby-identifier">value</span> = <span class="ruby-value str">&quot;Save changes&quot;</span>, <span class="ruby-identifier">options</span> = {})
349:         <span class="ruby-identifier">options</span>.<span class="ruby-identifier">stringify_keys!</span>
350: 
351:         <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">disable_with</span> = <span class="ruby-identifier">options</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-value str">&quot;disable_with&quot;</span>)
352:           <span class="ruby-identifier">disable_with</span> = <span class="ruby-node">&quot;this.value='#{disable_with}'&quot;</span>
353:           <span class="ruby-identifier">disable_with</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-node">&quot;;#{options.delete('onclick')}&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">options</span>[<span class="ruby-value str">'onclick'</span>]
354:           
355:           <span class="ruby-identifier">options</span>[<span class="ruby-value str">&quot;onclick&quot;</span>]  = <span class="ruby-value str">&quot;if (window.hiddenCommit) { window.hiddenCommit.setAttribute('value', this.value); }&quot;</span>
356:           <span class="ruby-identifier">options</span>[<span class="ruby-value str">&quot;onclick&quot;</span>] <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value str">&quot;else { hiddenCommit = this.cloneNode(false);hiddenCommit.setAttribute('type', 'hidden');this.form.appendChild(hiddenCommit); }&quot;</span>
357:           <span class="ruby-identifier">options</span>[<span class="ruby-value str">&quot;onclick&quot;</span>] <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-node">&quot;this.setAttribute('originalValue', this.value);this.disabled = true;#{disable_with};&quot;</span>
358:           <span class="ruby-identifier">options</span>[<span class="ruby-value str">&quot;onclick&quot;</span>] <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value str">&quot;result = (this.form.onsubmit ? (this.form.onsubmit() ? this.form.submit() : false) : this.form.submit());&quot;</span>
359:           <span class="ruby-identifier">options</span>[<span class="ruby-value str">&quot;onclick&quot;</span>] <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value str">&quot;if (result == false) { this.value = this.getAttribute('originalValue');this.disabled = false; }return result;&quot;</span>
360:         <span class="ruby-keyword kw">end</span>
361: 
362:         <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">confirm</span> = <span class="ruby-identifier">options</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-value str">&quot;confirm&quot;</span>)
363:           <span class="ruby-identifier">options</span>[<span class="ruby-value str">&quot;onclick&quot;</span>] <span class="ruby-operator">||=</span> <span class="ruby-value str">''</span>
364:           <span class="ruby-identifier">options</span>[<span class="ruby-value str">&quot;onclick&quot;</span>] <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-node">&quot;return #{confirm_javascript_function(confirm)};&quot;</span>
365:         <span class="ruby-keyword kw">end</span>
366: 
367:         <span class="ruby-identifier">tag</span> <span class="ruby-identifier">:input</span>, { <span class="ruby-value str">&quot;type&quot;</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">&quot;submit&quot;</span>, <span class="ruby-value str">&quot;name&quot;</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">&quot;commit&quot;</span>, <span class="ruby-value str">&quot;value&quot;</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">value</span> }.<span class="ruby-identifier">update</span>(<span class="ruby-identifier">options</span>.<span class="ruby-identifier">stringify_keys</span>)
368:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M002101" class="method-detail">
        <a name="M002101"></a>

        <div class="method-heading">
          <a href="#M002101" class="method-signature">
          <span class="method-name">text_area_tag</span><span class="method-args">(name, content = nil, options = {})</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Creates a text input area; use a textarea for longer text inputs such as
blog posts or descriptions.
</p>
<h4>Options</h4>
<ul>
<li><tt>:size</tt> - A string specifying the dimensions (columns by rows) of
the textarea (e.g., &quot;25x10&quot;).

</li>
<li><tt>:rows</tt> - Specify the number of rows in the textarea

</li>
<li><tt>:cols</tt> - Specify the number of columns in the textarea

</li>
<li><tt>:disabled</tt> - If set to true, the user will not be able to use this
input.

</li>
<li>Any other key creates standard HTML attributes for the tag.

</li>
</ul>
<h4>Examples</h4>
<pre>
  text_area_tag 'post'
  # =&gt; &lt;textarea id=&quot;post&quot; name=&quot;post&quot;&gt;&lt;/textarea&gt;

  text_area_tag 'bio', @user.bio
  # =&gt; &lt;textarea id=&quot;bio&quot; name=&quot;bio&quot;&gt;This is my biography.&lt;/textarea&gt;

  text_area_tag 'body', nil, :rows =&gt; 10, :cols =&gt; 25
  # =&gt; &lt;textarea cols=&quot;25&quot; id=&quot;body&quot; name=&quot;body&quot; rows=&quot;10&quot;&gt;&lt;/textarea&gt;

  text_area_tag 'body', nil, :size =&gt; &quot;25x10&quot;
  # =&gt; &lt;textarea name=&quot;body&quot; id=&quot;body&quot; cols=&quot;25&quot; rows=&quot;10&quot;&gt;&lt;/textarea&gt;

  text_area_tag 'description', &quot;Description goes here.&quot;, :disabled =&gt; true
  # =&gt; &lt;textarea disabled=&quot;disabled&quot; id=&quot;description&quot; name=&quot;description&quot;&gt;Description goes here.&lt;/textarea&gt;

  text_area_tag 'comment', nil, :class =&gt; 'comment_input'
  # =&gt; &lt;textarea class=&quot;comment_input&quot; id=&quot;comment&quot; name=&quot;comment&quot;&gt;&lt;/textarea&gt;
</pre>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M002101-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M002101-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/rails/actionpack/lib/action_view/helpers/form_tag_helper.rb, line 253</span>
253:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">text_area_tag</span>(<span class="ruby-identifier">name</span>, <span class="ruby-identifier">content</span> = <span class="ruby-keyword kw">nil</span>, <span class="ruby-identifier">options</span> = {})
254:         <span class="ruby-identifier">options</span>.<span class="ruby-identifier">stringify_keys!</span>
255: 
256:         <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">size</span> = <span class="ruby-identifier">options</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-value str">&quot;size&quot;</span>)
257:           <span class="ruby-identifier">options</span>[<span class="ruby-value str">&quot;cols&quot;</span>], <span class="ruby-identifier">options</span>[<span class="ruby-value str">&quot;rows&quot;</span>] = <span class="ruby-identifier">size</span>.<span class="ruby-identifier">split</span>(<span class="ruby-value str">&quot;x&quot;</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">size</span>.<span class="ruby-identifier">respond_to?</span>(<span class="ruby-identifier">:split</span>)
258:         <span class="ruby-keyword kw">end</span>
259: 
260:         <span class="ruby-identifier">content_tag</span> <span class="ruby-identifier">:textarea</span>, <span class="ruby-identifier">content</span>, { <span class="ruby-value str">&quot;name&quot;</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">name</span>, <span class="ruby-value str">&quot;id&quot;</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">name</span> }.<span class="ruby-identifier">update</span>(<span class="ruby-identifier">options</span>.<span class="ruby-identifier">stringify_keys</span>)
261:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M002096" class="method-detail">
        <a name="M002096"></a>

        <div class="method-heading">
          <a href="#M002096" class="method-signature">
          <span class="method-name">text_field_tag</span><span class="method-args">(name, value = nil, options = {})</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Creates a standard text field; use these text fields to input smaller
chunks of text like a username or a search query.
</p>
<h4>Options</h4>
<ul>
<li><tt>:disabled</tt> - If set to true, the user will not be able to use this
input.

</li>
<li><tt>:size</tt> - The number of visible characters that will fit in the
input.

</li>
<li><tt>:maxlength</tt> - The maximum number of characters that the browser
will allow the user to enter.

</li>
<li>Any other key creates standard HTML attributes for the tag.

</li>
</ul>
<h4>Examples</h4>
<pre>
  text_field_tag 'name'
  # =&gt; &lt;input id=&quot;name&quot; name=&quot;name&quot; type=&quot;text&quot; /&gt;

  text_field_tag 'query', 'Enter your search query here'
  # =&gt; &lt;input id=&quot;query&quot; name=&quot;query&quot; type=&quot;text&quot; value=&quot;Enter your search query here&quot; /&gt;

  text_field_tag 'request', nil, :class =&gt; 'special_input'
  # =&gt; &lt;input class=&quot;special_input&quot; id=&quot;request&quot; name=&quot;request&quot; type=&quot;text&quot; /&gt;

  text_field_tag 'address', '', :size =&gt; 75
  # =&gt; &lt;input id=&quot;address&quot; name=&quot;address&quot; size=&quot;75&quot; type=&quot;text&quot; value=&quot;&quot; /&gt;

  text_field_tag 'zip', nil, :maxlength =&gt; 5
  # =&gt; &lt;input id=&quot;zip&quot; maxlength=&quot;5&quot; name=&quot;zip&quot; type=&quot;text&quot; /&gt;

  text_field_tag 'payment_amount', '$0.00', :disabled =&gt; true
  # =&gt; &lt;input disabled=&quot;disabled&quot; id=&quot;payment_amount&quot; name=&quot;payment_amount&quot; type=&quot;text&quot; value=&quot;$0.00&quot; /&gt;

  text_field_tag 'ip', '0.0.0.0', :maxlength =&gt; 15, :size =&gt; 20, :class =&gt; &quot;ip-input&quot;
  # =&gt; &lt;input class=&quot;ip-input&quot; id=&quot;ip&quot; maxlength=&quot;15&quot; name=&quot;ip&quot; size=&quot;20&quot; type=&quot;text&quot; value=&quot;0.0.0.0&quot; /&gt;
</pre>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M002096-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M002096-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/rails/actionpack/lib/action_view/helpers/form_tag_helper.rb, line 114</span>
114:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">text_field_tag</span>(<span class="ruby-identifier">name</span>, <span class="ruby-identifier">value</span> = <span class="ruby-keyword kw">nil</span>, <span class="ruby-identifier">options</span> = {})
115:         <span class="ruby-identifier">tag</span> <span class="ruby-identifier">:input</span>, { <span class="ruby-value str">&quot;type&quot;</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">&quot;text&quot;</span>, <span class="ruby-value str">&quot;name&quot;</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">name</span>, <span class="ruby-value str">&quot;id&quot;</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">sanitize_to_id</span>(<span class="ruby-identifier">name</span>), <span class="ruby-value str">&quot;value&quot;</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">value</span> }.<span class="ruby-identifier">update</span>(<span class="ruby-identifier">options</span>.<span class="ruby-identifier">stringify_keys</span>)
116:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>


    </div>


  </div>


<div id="validator-badges">
  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
</div>

</body>
</html>